import { reqGetSearchResult,reqGetSearchList } from "@/api";
const state = {
    searchResult:[],
    totalNums:0
}

const actions = {
    async getSearchResult({commit},params) {
        let result = await reqGetSearchList(params);
        if(result.code == 200){
            commit("GETSEARCHRESULT",result.data)
        }
    }
}
const mutations = {
    GETSEARCHRESULT(state,{goodList,totalNums}){
        state.searchResult = goodList;
        state.totalNums = totalNums;
    }
}

const getters = {}

export default {
    namespaced: true,
    actions,
    mutations,
    state,
    getters
}
